<template>
    <div class="left-box">
        <titleComponent title="项目情况"></titleComponent>
        <div class="center">
            <img src="../../../assets/img/img1.png" class="icon"/>
            <div class="">
                <div class="title-box">
                    <div class="name">项目整体利润率</div>
                    <div class="num">{{getNum(project && project.total ? project.total : 0)}}%</div>
                </div>
                <div class="bg">
                    <div class="bar" :style="{width: getNum(project && project.total ? project.total : 0) + '%'}"></div>
                </div>
            </div>
        </div>
        <div class="echarts-box">
            <div class="pie-box">
                <div class="pie-bg">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(34,225,191'" titleText="自主实施率" :dataList="[getNum(project && project.selfPre ? project.selfPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg-blue">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(16,137,255'" bgColor="#b6e3fd" titleText="通服毛利率" :dataList="[getNum(project && project.tongFuPre ? project.tongFuPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg-blue">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(16,137,255'" bgColor="#b6e3fd" titleText="自有产品接入率" :dataList="[getNum(project && project.ziYouPre ? project.ziYouPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg-blue">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(16,137,255'" bgColor="#b6e3fd" titleText="自研产品植入率" :dataList="[getNum(project && project.ziYanPre ? project.ziYanPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(34,225,191'" :titleText="'交付及时率'" :dataList="[getNum(project && project.jiaoFuPre ? project.jiaoFuPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(34,225,191'" :titleText="'前置商机完整率'" :dataList="[getNum(project && project.qianZhiPre ? project.qianZhiPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(34,225,191'" :titleText="'应收款占收比'" :dataList="[getNum(project && project.ydkPre ? project.ydkPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(34,225,191'" :titleText="'应验未验比重'" :dataList="[getNum(project && project.yywyPre ? project.yywyPre : 0)]"></percentPie>
            </div>
            <div class="pie-box">
                <div class="pie-bg-yellow">
                    <div class="pie-center-bg"></div>
                </div>
                <percentPie :colorArr="'rgb(255,177,68'" bgColor="#fcf1d1" titleText="项目管控能力" :dataList="[getNum(project && project.projectMgrPre ? project.projectMgrPre : 0)]"></percentPie>
            </div>
        </div>
    </div>
</template>
<script>
    import titleComponent from "./titleComponent";
    import percentPie from "./percentPie.vue";
    export default {
        props:{
            project: {
                type: Object,
                default: () => {},
            }
        },
        components: {
            titleComponent,
            percentPie
        },
        methods: {
            getNum(num){
                return num * 100
            }
        }
    }
</script>
<style lang="less" scoped>
.left-box {
    width: 446px;
    height: 600px;
    background: #fff;
    margin-bottom: 16px;
    padding: 16px;
    box-sizing: border-box;
}
.center{
    background: #edf2fe;
    width: 100%;
    height: 80px;
    border-radius: 7px;
    margin-top: 16px;
    display: flex;
    .icon{
        margin: 14px;
    }
}
.title-box{
   display: flex;
   justify-content: space-between;
   width: 320px;
   margin: 16px 0 6px;
   .name{
    font-size: 18px;
    margin-top: 2px;
   }
   .num{
    font-size: 24px;
    font-weight: 900;
   }
}
.bg{
    width: 100%;
    height: 6px;
    background: #d4dffe;
    border-radius: 10px;
    .bar{
        height: 6px;
        border-radius: 10px;
        background: linear-gradient(to right, #8ef5fb, #30b3ff);
    }
}
.pie-box{
    width: 33.3%;
    height: 150px;
    position: relative;
}
.echarts-box{
    display: flex;
    flex-wrap: wrap;
}
.pie-bg{
    width: 90px;
    height: 90px;
    border-radius: 100px;
    background: linear-gradient(to bottom, #bdf7ed, #fff);
    position: absolute;
    top: 30px;
    left: 25px;
    .pie-center-bg{
        width: 62px;
        height: 62px;
        border-radius: 100px;
        background:linear-gradient(to bottom, #b1f5e9,#d1f9f3);
        margin: 14px;
    }
}
.pie-bg-blue{
    width: 90px;
    height: 90px;
    border-radius: 100px;
    background: linear-gradient(to bottom, #c4e9ff, #fff);
    position: absolute;
    top: 30px;
    left: 25px;
    .pie-center-bg{
        width: 62px;
        height: 62px;
        border-radius: 100px;
        background:linear-gradient(to bottom, #a9defd,#cdebfc);
        margin: 14px;
    }
}
.pie-bg-yellow{
    width: 90px;
    height: 90px;
    border-radius: 100px;
    background: linear-gradient(to bottom, #fcebbb, #fff);
    position: absolute;
    top: 30px;
    left: 25px;
    .pie-center-bg{
        width: 62px;
        height: 62px;
        border-radius: 100px;
        background:linear-gradient(to bottom, #fde8af,#fcefcb);
        margin: 14px;
    }
}
</style>